import React from 'react'
import Child from './child'
import { Button } from 'antd'
import './index.less'
export default class Life extends React.Component {
  constructor (props) {
    super(props)
    this.state = {
      count: 0,
      name: 'jack'
    }
  }
  render () {
    return <div>
      <p className='title'>生命周期</p>
      <button onClick={this.handleAdd}>点击一下</button>
      <Button>andt</Button>
      <p>{this.state.count}</p>
      <Child name={this.state.name}/>
    </div>
  }
  handleAdd  = () =>{
    this.setState({
      count: this.state.count + 1
    })
  }
}